package com.example.myapplication;

import android.view.View;
import android.widget.AdapterView;
import android.widget.AdapterView.OnItemSelectedListener;
import android.widget.Toast;

public class MyOnItemSelectedListener implements OnItemSelectedListener {

	@Override
	public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
	     Toast.makeText(parent.getContext(), 
                 "The planet is " + parent.getItemAtPosition(position).toString(), Toast.LENGTH_LONG) 
                 .show(); 

	}

	@Override
	public void onNothingSelected(AdapterView<?> parent) {
	

	}

}
